home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C & C++ Multimedia Cyber Classroom
/
C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso
/
src
/
fig03_25.jar
/
Ch03
/
Fig03_25
/
Fig03_25.cpp
Wrap
C/C++ Source or Header
|
1997-10-11
|
350b
|
18 lines
// Fig. 3.25: fig03_25.cpp
// Using overloaded functions
#include <iostream.h>
int square( int x ) { return x * x; }
double square( double y ) { return y * y; }
int main()
{
cout << "The square of integer 7 is " << square( 7 )
<< "\nThe square of double 7.5 is " << square( 7.5 )
<< endl;
return 0;
}